using System;

using Pegasus.Diagnostics;

namespace Pegasus.Workflow.Service
{
	/// <summary>
	/// Event args for when an exception occurs
	/// </summary>
	[Serializable]
	public class WorkflowExceptionEventArgs : WorkflowEventArgs
	{
		// Local Instance Values
		private Exception m_exception;

		/// <summary>
		/// Initializes a new instance of the <see cref="T:WorkflowExceptionEventArgs"/> class.
		/// </summary>
		/// <param name="workflowId">The workflow id.</param>
		/// <param name="e">The e.</param>
		public WorkflowExceptionEventArgs( int workflowId, Exception e ) :
			base( workflowId )
		{
			// Check Parameters
			ParamCode.AssertRange( workflowId, 1, int.MaxValue, "workflowId" );
			ParamCode.AssertNotNull( e, "e" );

			m_exception = e;
		}

		/// <summary>
		/// Gets the exception.
		/// </summary>
		/// <value>The exception.</value>
		public Exception Exception
		{
			get
			{
				return m_exception;
			}
		}
	}
}
